package com.ziyueyuwen.xiniao.bean.page;


import java.util.List;

/**
 * @author wancheng  on 2018/8/8.
 */
public class PageData<T> {


    private List<T> data;

    private Object total;

    private Object otherMsg;

    private Integer totalPage;

    private Integer page = 1;

    private Integer rows = 10;

    private Integer before = 0;

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getRows() {
        return rows;
    }

    public void setRows(Integer rows) {
        this.rows = rows;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public Object getOtherMsg() {
        return otherMsg;
    }

    public void setOtherMsg(Object otherMsg) {
        this.otherMsg = otherMsg;
    }

    public Object getTotal() {
        return total;
    }

    public void setTotal(Object total) {
        this.total = total;
    }

    public Integer getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public Integer getBefore() {
        before = (page - 1) * rows;
        return before;
    }

    public void setBefore(Integer before) {
        this.before = before;
    }

    public PageData(Integer page, Integer rows, List<T> data, Object total, Integer totalPage) {
        this.page = page;
        this.rows = rows;
        this.data = data;
        this.total = total;
        this.totalPage = totalPage;
    }

    public PageData() {
    }
}
